<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>基本账户</title>
<!--bootstrap.min.css-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--font-awesome.css?v=4.4.0-->
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!--bootstrap.min.css-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <!--custom.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/plugins/iCheck/custom.css"/>
	<!--style.css-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/plugins/toastr/toastr.min.css"/>
	<!--jquery.min.js-->
	<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="">
    <ol class="breadcrumb">
        <li>电子银行</li>
        <li class="active">基本账户</li>
    </ol>
     <div class="panel panel-success">
        <!-- <div class="panel-heading">
            <h3 class="panel-title">消费账户列表</h3>
        </div> -->
        <br />
         <form action="<%=basePath%>ZhuanZhangServlet/listMemberInfo">
           <!--  <div class="panel-body">
            <span style="font-size: 16px">
             	这里是消费账户列表。。。
            </span>
               	 
                <button href=" " class="btn btn-primary pull-right">搜索</button>
            </div> -->
           <div class="col-sm-3 pull-right">
           		<div class="input-group">
           			<input type="text" name="user_name" placeholder="请输入会员姓名..." value="${user_name}" class="form-control">
           			<span class="input-group-btn">
           				<button type="submit" id="select" class="btn btn-primary fa fa-search">&nbsp;搜索</button>
           			</span>
           		</div>
           </div>
            <!--  <button href="" class="btn btn-primary pull-right">搜索</button> -->
            <table class="table table-bordered table-hover" style="table-layout: fixed" >
                <tr>
                    <th><input type="checkbox" name="" id="all"></th>
                    <th>交易单号</th>
                    <th>会员姓名</th>
                    <th>银行名称</th>
                    <th>入账金额</th>
                    <th>时间</th>
                    <th>余额</th>
                    <th>删除记录</th>
                </tr>
              <%--   <tr>
                <td></td>
                <td style="padding: 0"><input type="text" name="trade_id" id="" class="form-control" style="border: 0" placeholder="输入查找..." value="${parameterMap.trade_id[0]}"></td>
		        <td style="padding: 0"><input type="text" name="user_name" id="" class="form-control" style="border: 0" placeholder="输入查找..." value="${parameterMap.user_name[0]}"></td>
		        <td style="padding: 0"><input type="text" name="bank_name" id="" class="form-control" style="border: 0" placeholder="输入查找..." value="${parameterMap.bank_name[0]}"></td>
		        <td style="padding: 0"><input type="text" name="money" id="" class="form-control" style="border: 0" placeholder="输入查找..." value="${parameterMap.money[0]}"></td>
		        <td></td>
		        <td></td>
		        <td></td>
                </tr> --%>
                <c:forEach items="${zhuanzhangList}" var="zhuanzhang">
                    <tr>
                        <td><input type="checkbox" name="trade_id" class="che" value="${zhuanzhang.trade_id}"></td>
                        <td>${zhuanzhang.trade_id}</td>
                        <td>${zhuanzhang.user_name}</td>
                        <td>${zhuanzhang.bank_name}</td>
                        <td>${zhuanzhang.money}</td>
                        <td>${zhuanzhang.time}</td>
                        <td>${zhuanzhang.user_money}</td>
                        <td><div class="btn btn-sm btn-link delete" onclick="removeById(this)"  trade_id="${zhuanzhang.trade_id}"><span class="glyphicon glyphicon-trash"></span></div></td>
                    </tr>
                </c:forEach>
            </table>
            <div class="btn btn-danger" onclick="removeSelect()">删除选中</div>
        </form>
    <div class="pag" style="margin-left:350px"> </div>
    </div>
</div>


</body>
<!--bootstrap.min.js-->
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!--jquery.peity.min.js-->
<script src="<%=basePath%>js/plugins/peity/jquery.peity.min.js" type="text/javascript" charset="utf-8"></script>
<!--content.js-->
<script src="<%=basePath%>js/content.js" type="text/javascript" charset="utf-8"></script>
<!--icheck.min.js-->
<script src="<%=basePath%>js/plugins/iCheck/icheck.min.js" type="text/javascript" charset="utf-8"></script>
<!--peity-demo.js-->
<script src="<%=basePath%>js/demo/peity-demo.js" type="text/javascript" charset="utf-8"></script>
<!--layer.min.js-->
<script src="<%=basePath%>js/plugins/layer/layer.min.js" type="text/javascript" charset="utf-8"></script>
<!-- 分页的js -->
<script src="<%=basePath%>js/plugins/jquery-bootstrap-pagination/jquery-bootstrap-pagination.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>js/plugins/toastr/toastr.min.js" type="text/javascript" charset="utf-8"></script>
<script>
	/* 分页 */
	$(".pag").pagination({
		total_pages:${pageCount},
	    current_page:${pageNum},
	    prev:"上一页",
	    next:"下一页",
	    display_max: 4,
	    callback:function (event,page) {
	        location="<%=basePath%>ZhuanZhangServlet/findALLBySplit?pageNum="+page;
	    }
	});
	
	/* 选中所有的文件 */
	$("#all").click(function() {
		$(":checkbox").prop('checked',$(this).prop('checked'));
	});

	//删除按钮
	 function removeById(obj) {
        //ajax：
        $.get('${pageContext.request.contextPath}/ZhuanZhangServlet/removeById',{"trade_id":$(obj).attr('trade_id')},function (s) {
            if(s==1){
                $(obj).parent().parent().remove();
                layer.msg('删除成功',function(){
                	time:1000
                });
                
            }else{
                alert('失败');
            }
        });
    };
	
	//删除一列
	function removeSelect() {
        $.get('${pageContext.request.contextPath}/ZhuanZhangServlet/removeAll',$('.che').serialize(),function (s) {
            if(s==1){
               
                layer.msg('删除成功',{icon: 1},function(){
                	time:500,
                	 location.reload();
                });
            }else{
                layer.alert('请选中后再删除',{icon: 5});
            }
        });
    };
	
	




</script>
</html>